package cn.kgc.javaweb.service.impl;

import cn.kgc.javaweb.dao.UserDao;
import cn.kgc.javaweb.dao.UserDaoImpl;
import cn.kgc.javaweb.entity.User;
import cn.kgc.javaweb.service.UserService;

/**
 * @author: mosin
 * @version: v1.0  2022/3/24
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();


    @Override
    public boolean addUser(User user) {
        int line = userDao.insert(user);
        return line>0;
    }

    @Override
    public boolean login(User user) {
        User usr =  userDao.selectByUser(user);
        return usr!=null;
    }
}
